Identifying methods with a specified Id in D [migrated]
Posted
by
Ekyo777
on Programmers
See other posts from Programmers
or by Ekyo777
Published on 2012-06-26T15:46:04Z
Indexed on
2012/06/26
21:25 UTC
Read the original article
Hit count: 184
d
I want to have specific methods with a specific pattern recognized at compile time and registered along with a specified id trough mixins in a parent class.
ex.: take a method 'X' from a class with a predetermined id:5, what I want is that, in a mixin in a parent class, method X will be registered as a delegate with its id to be called later on by its id.
What would be the best way to specify the Id considering I want the id to be of type int and only the specified methods to be registered?
should I (if it is even possible) do it with a custom annotation pretty much like the @property but with an argument, like:
@autoregister(id)
void method(...)
if it is possible to do it this way, an example or a link to the documentation on how to do it would be nice since I didn't find it in the documentation.
© Programmers or respective owner